package fpsf
{	
	public class AssignExternalContent
	{
		private var assignA:Array = new Array();
		private var assignO:Object;
		private var loadText:String;
		private var type:int;
		
		public static var HTMLText:int = 0;
		public static var Text:int = 1;
		public static var Label:int = 2;
		
		public function AssignExternalContent(url:String, loadText:String, o:Object, type:int)
		{
			assignO = o;
			this.loadText = loadText;
			this.type = type;
			
			assignA2O(loadText);
			new ExternalLoading(url,assignA,assign);
		}
		
		private function assign():void
		{
			assignA2O(assignA[0].toString());
		}
		
		private function assignA2O(s:String):void
		{
			switch (type) {
				case AssignExternalContent.HTMLText:
					assignO.htmlText = s;
					break;
				case AssignExternalContent.Text:
					assignO.text = s;
					break;
				case AssignExternalContent.Label:
					assignO.label = s;
					break;
			}
		}

	}
}